{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}首页{% endblock %} - Badd 博客系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <style>
        .post {
            margin-bottom: 5px; // 每个post卡片下面的间隔
        }
        .comment-content{
             margin-left: 25px;
        }

    </style>
    {% block extra_head %}
    {% endblock %}
</head>
<body>
    <div class="container head">
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <a class="navbar-brand" href="/">首页</a>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    {% for c in navs %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'category-list' c.id %}">{{ c.name }}</a>
                    </li>

                    {% endfor %}
                    <li class="nav-item"><a class="nav-link" href="{% url 'rss' %}"><span class="ion-social-rss-outline"></span> RSS 订阅</a></li>

                </ul>
                <form class="form-inline my-2 my-lg-0" action="/search/" method="GET">
                    <input class="form-control mr-sm-2" type="search" placeholder="Search"
                           aria-label="Search" name="keyword" value="{{keyword}}">
                    <button class="btn btn-outline-success" type="submit">搜索</button>
                </form>

            </div>
        </nav>
        <div class="jumbotron">
            <h1 class="display-4">Badd</h1>
            <p class="lead">博客系统</p>
        </div>

    </div>
    <div class="container main">
        <div class="row">
            <div class="col-9 post-list">
            {% block main %}
            {% endblock %}
            </div>
            <div class="col-3">
                <div class="card-body">
                    <div class="card-body">
                        <h4 class="card-title">个人评价:</h4>

                        <p>
                            人生无常，大肠包小肠...
                        </p>
                    </div>
                </div>
                {% block sidebar %}
                    {% for sidebar in sidebars %}
<!--                <div class="card post">-->
                    <div class="card-body">
                        <div class="card-body">
                            <h4 class="card-title">{{ sidebar.title }}</h4>

                            <p>
                                {{ sidebar.content_html }}
                            </p>
                        </div>
                    </div>
<!--                </div>-->

                    {% endfor %}
                {% endblock %}
            </div>
        </div>
    </div>

    <footer class="footer">
        {% block footer %}
        <div class="container">
            <hr/>
            <nav class="nav category">
                {% for c in categories %}
                <a href="{% url 'category-list' c.id %}" class="nav-link">{{ c.name }}</a>
                {% endfor %}
            </nav>
        </div>
        <div class="container power">
            <span class="text-muted">Power by Badd@badd.com</span>
        </div>
        {% endblock %}
    </footer>
</body>
</html>